﻿using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using Hongsh.Pay.Client.Proxy.Http;
using MapleLeaf.Pay;
using MapleLeaf.Pay.Pay;
using MapleLeaf.Pay.Trade;
using Newtonsoft.Json;

namespace Hongsh.Pay.Client.Proxy.Handlers {
    // Token: 0x0200006D RID: 109
    public static class SissPayProxy {
        // Token: 0x060003A6 RID: 934 RVA: 0x0000EFB8 File Offset: 0x0000D1B8
        public static void AddSissPayProxyHandler(this HttpServer svr) {
            svr.RouterList.Add("GET/api/mchinfo", new HttpContextActionDelegate(Active));
            svr.RouterList.Add("GET/api/mchinfo2", new HttpContextActionDelegate(Active));
            svr.RouterList.Add("POST/api/mchinfo", new HttpContextActionDelegate(Active));
            svr.RouterList.Add("POST/api/mchinfo2", new HttpContextActionDelegate(Active));
            svr.RouterList.Add("POST/sisspay/tradepay", new HttpContextActionDelegate(ProcV1));
            svr.RouterList.Add("POST/sisspay/tradequery", new HttpContextActionDelegate(ProcV1));
            svr.RouterList.Add("POST/sisspay/traderefund", new HttpContextActionDelegate(ProcV1));
            svr.RouterList.Add("POST/sisspay/v2tradepay", new HttpContextActionDelegate(ProcV2));
            svr.RouterList.Add("POST/sisspay/v2tradequery", new HttpContextActionDelegate(ProcV2));
            svr.RouterList.Add("POST/sisspay/v2traderefund", new HttpContextActionDelegate(ProcV2));
        }

        // Token: 0x060003A7 RID: 935 RVA: 0x00004494 File Offset: 0x00002694
        private static void Active(HttpContext ctx) {
            ctx.Result = ActiveResult;
        }

        // Token: 0x060003A8 RID: 936 RVA: 0x0000F0E0 File Offset: 0x0000D2E0
        private static void ProcV1(HttpContext ctx) {
            string json = new StreamReader(ctx.Request).ReadToEnd();
            SISSPayRequest sisspayRequest = json.JsonDecode<SISSPayRequest>();
            SISSPayResult sisspayResult = new SISSPayResult {
                code = "SUCCESS",
                out_trade_no = sisspayRequest.UPNo,
                pay_way = sisspayRequest.pay_way
            };
            try {
                HongshPayTrade hongshPayTrade;
                if (ctx.Request.Url.AbsolutePath.Equals("/sisspay/traderefund", StringComparison.OrdinalIgnoreCase)) {
                    hongshPayTrade = ctx.Execute(new TradeRefundRequest {
                        ClientTradeId = sisspayRequest.UPNo,
                        ClientRefundTradeId = sisspayRequest.out_Request_no,
                        RefundAmount = (int)(sisspayRequest.UPRefundAmount * 100m)
                    });
                    if (hongshPayTrade.State != TradeState.成功) {
                        throw new Exception("退款失败：" + hongshPayTrade.StateDescript);
                    }
                }
                else if (ctx.Request.Url.AbsolutePath.Equals("/sisspay/tradepay", StringComparison.OrdinalIgnoreCase)) {
                    TradeAuthPaymentRequest tradeAuthPaymentRequest = new TradeAuthPaymentRequest {
                        ClientTradeId = sisspayRequest.UPNo,
                        Amount = (int)(sisspayRequest.UPAmount * 100m),
                        Authcode = sisspayRequest.String_0
                    };
                    try {
                        if (!sisspayRequest.goods_detail.IsNullOrEmpty<SISSGood>()) {
                            TradeBuildRequest tradeBuildRequest = tradeAuthPaymentRequest;
                            SISSGood[] goods_detail = sisspayRequest.goods_detail;
                            TradeGoods[] goodsList;
                            if (goods_detail == null) {
                                goodsList = null;
                            }
                            else {
                                goodsList = (from g in goods_detail
                                             select new TradeGoods {
                                                 Id = g.goods_id,
                                                 Name = g.goods_name,
                                                 Price = (int)(decimal.Parse(g.price) * 100m),
                                                 Quantity = double.Parse(g.quantity)
                                             }).ToArray<TradeGoods>();
                            }
                            tradeBuildRequest.GoodsList = goodsList;
                        }
                    }
                    catch {
                    }
                    hongshPayTrade = ctx.Execute(tradeAuthPaymentRequest);
                    if (hongshPayTrade.State == TradeState.关闭 || hongshPayTrade.State == TradeState.失败) {
                        sisspayResult.code = "NOPAY";
                    }
                    else if (hongshPayTrade.State != TradeState.成功) {
                        sisspayResult.code = "WAIT_BUYER_PAY";
                    }
                }
                else {
                    if (!ctx.Request.Url.AbsolutePath.Equals("/sisspay/tradequery", StringComparison.OrdinalIgnoreCase)) {
                        throw new Exception("不支持的业务请求！");
                    }
                    hongshPayTrade = ctx.Execute(new TradePaymentQueryRequest {
                        ClientTradeId = sisspayRequest.UPNo
                    });
                }
                if (hongshPayTrade.State == TradeState.成功) {
                    sisspayResult.trade_status = "TRADE_SUCCESS";
                }
                else if (hongshPayTrade.State == TradeState.未知) {
                    sisspayResult.trade_status = "WAIT_BUYER_PAY";
                }
                else {
                    sisspayResult.trade_status = "NOPAY";
                    sisspayResult.msg = (!string.IsNullOrEmpty(hongshPayTrade.StateDescript)) ? hongshPayTrade.StateDescript : "交易失败或超时，请撤销交易！";
                }
                if (string.IsNullOrEmpty(sisspayResult.pay_way)) {
                    switch (hongshPayTrade.Payway) {
                        case TradePayway.微信:
                            sisspayResult.pay_way = "WX";
                            break;
                        case TradePayway.支付宝:
                            sisspayResult.pay_way = "ALI";
                            break;
                        case TradePayway.云闪付:
                            sisspayResult.pay_way = "UNIONPAY";
                            break;
                    }
                }
                sisspayResult.trade_no = hongshPayTrade.TradeId;
                sisspayResult.trade_time = hongshPayTrade.UpdateTime.ToString("yyyy-MM-dd HH:mm:ss");
                sisspayResult.total_amount = (hongshPayTrade.Amount / 100m).ToString("0.00");
            }
            catch (Exception ex) {
                sisspayResult.code = "FAIL";
                sisspayResult.msg = ex.Message;
            }
            ctx.Result = new HttpJsonResult(sisspayResult);
        }

        // Token: 0x060003A9 RID: 937 RVA: 0x0000F458 File Offset: 0x0000D658
        private static void ProcV2(HttpContext ctx) {
            string json = new StreamReader(ctx.Request).ReadToEnd();
            SissPayRequestV2 sissPayRequestV = json.JsonDecode<SissPayRequestV2>();
            string @string = Encoding.UTF8.GetString(sissPayRequestV.req_aes_data.Base64Decode());
            SissPayAes sissPayAes = @string.JsonDecode<SissPayAes>();
            Aes aes = Aes.Create();
            aes.Key = Encoding.ASCII.GetBytes(sissPayAes.k);
            aes.IV = Encoding.ASCII.GetBytes(sissPayAes.v);
            string json2 = aes.Decrypt(sissPayAes.d.Base64Decode());
            SissPayAesData sissPayAesData = json2.JsonDecode<SissPayAesData>();
            SissPayResultV2 sissPayResultV = new SissPayResultV2 {
                pay_way = sissPayRequestV.pay_way,
                out_trade_no = sissPayRequestV.out_trade_no,
                code = "SUCCESS"
            };
            if (string.IsNullOrEmpty(sissPayRequestV.out_trade_no)) {
                sissPayRequestV.auth_code = sissPayAesData.auth_code;
                sissPayRequestV.total_amount = sissPayAesData.total_amount;
                sissPayResultV.out_trade_no = sissPayRequestV.out_trade_no = sissPayAesData.out_trade_no;
            }
            if (sissPayRequestV.goods_detail == null) {
                sissPayRequestV.goods_detail = sissPayAesData.goods_detail;
            }
            try {
                HongshPayTrade hongshPayTrade;
                if (ctx.Request.Url.AbsolutePath.Equals("/sisspay/v2traderefund", StringComparison.OrdinalIgnoreCase)) {
                    TradeRefundRequest req = new TradeRefundRequest {
                        ClientTradeId = sissPayRequestV.out_trade_no.Trim(new char[]
                        {
                            '0'
                        }),
                        ClientRefundTradeId = sissPayRequestV.out_request_no.Trim(new char[]
                        {
                            '0'
                        }),
                        RefundAmount = (int)(sissPayRequestV.refund_amount * 100m)
                    };
                    hongshPayTrade = ctx.Execute(req);
                    if (hongshPayTrade.State != TradeState.成功) {
                        throw new Exception("退款失败：" + hongshPayTrade.StateDescript);
                    }
                }
                else {
                    if (ctx.Request.Url.AbsolutePath.Equals("/sisspay/v2tradepay", StringComparison.OrdinalIgnoreCase)) {
                        TradeAuthPaymentRequest tradeAuthPaymentRequest = new TradeAuthPaymentRequest {
                            ClientTradeId = sissPayRequestV.out_trade_no.Trim(new char[]
                            {
                                '0'
                            }),
                            Amount = (int)(sissPayRequestV.total_amount.Value * 100m),
                            Authcode = sissPayRequestV.auth_code
                        };
                        if (!sissPayRequestV.goods_detail.IsNullOrEmpty<SISSGood>()) {
                            try {
                                TradeBuildRequest tradeBuildRequest = tradeAuthPaymentRequest;
                                SISSGood[] goods_detail = sissPayRequestV.goods_detail;
                                TradeGoods[] goodsList;
                                if (goods_detail == null) {
                                    goodsList = null;
                                }
                                else {
                                    goodsList = (from g in goods_detail
                                                 select new TradeGoods {
                                                     Id = g.goods_id,
                                                     Name = g.goods_name,
                                                     Price = (int)(decimal.Parse(g.price) * 100m),
                                                     Quantity = double.Parse(g.quantity)
                                                 }).ToArray<TradeGoods>();
                                }
                                tradeBuildRequest.GoodsList = goodsList;
                            }
                            catch {
                            }
                        }
                        hongshPayTrade = ctx.Execute(tradeAuthPaymentRequest);
                        if (hongshPayTrade.State == TradeState.未知) {
                            sissPayResultV.code = "WAIT_BUYER_PAY";
                        }
                        else if (hongshPayTrade.State != TradeState.成功) {
                            sissPayResultV.code = "NOPAY";
                        }
                    }
                    else {
                        if (!ctx.Request.Url.AbsolutePath.Equals("/sisspay/v2tradequery", StringComparison.OrdinalIgnoreCase)) {
                            throw new Exception("不支持的业务请求！");
                        }
                        hongshPayTrade = ctx.Execute(new TradePaymentQueryRequest {
                            ClientTradeId = sissPayRequestV.out_trade_no.Trim(new char[]
                            {
                                '0'
                            })
                        });
                    }
                    if (hongshPayTrade.State == TradeState.成功) {
                        sissPayResultV.trade_status = "TRADE_SUCCESS";
                    }
                    else if (hongshPayTrade.State == TradeState.未知) {
                        sissPayResultV.trade_status = "WAIT_BUYER_PAY";
                    }
                    else {
                        sissPayResultV.trade_status = "NOPAY";
                        sissPayResultV.msg = (!string.IsNullOrEmpty(hongshPayTrade.StateDescript)) ? hongshPayTrade.StateDescript : "交易失败或超时，请撤销交易！";
                    }
                    sissPayResultV.receipt_amount = sissPayResultV.total_amount = (hongshPayTrade.Amount > 0) ? (hongshPayTrade.Amount / 100m).ToString("0.00") : ((sissPayRequestV.total_amount == null) ? null : sissPayRequestV.total_amount.Value.ToString("0.00"));
                }
                if (string.IsNullOrEmpty(sissPayResultV.pay_way)) {
                    switch (hongshPayTrade.Payway) {
                        case TradePayway.微信:
                            sissPayResultV.pay_way = "WX";
                            break;
                        case TradePayway.支付宝:
                            sissPayResultV.pay_way = "ALI";
                            break;
                        case TradePayway.云闪付:
                            sissPayResultV.pay_way = "UNIONPAY";
                            break;
                    }
                }
                sissPayResultV.trade_no = hongshPayTrade.TradeId;
                sissPayResultV.trade_time = DateTime.Now.ToString();
            }
            catch (Exception ex) {
                sissPayResultV.code = "FAIL";
                sissPayResultV.msg = ex.Message;
            }
            sissPayResultV.rsp_aes_data = aes.Encrypt(new {
                random_str_a = sissPayAes.r,
                random_str_b = sissPayAesData.random_str_b,
                code = sissPayResultV.code
            }.JsonEncode(Formatting.None)).Base64Encode();
            ctx.Result = new HttpJsonResult(sissPayResultV);
        }

        // Token: 0x060003AA RID: 938 RVA: 0x0000F97C File Offset: 0x0000DB7C
        static SissPayProxy() {
            //Class15.cwcZ3SWztHroi();
            ActiveResult = new HttpJsonResult(new {
                code = "SUCCESS",
                siss_pay_id = Guid.NewGuid().ToString("N"),
                merchant_name = Guid.NewGuid().ToString("N"),
                siss_pay_channel = "SWIFTPASS"
            });
        }

        // Token: 0x0400018F RID: 399
        private static HttpJsonResult ActiveResult;

        // Token: 0x0200006E RID: 110
        private class SISSGood {
            // Token: 0x17000197 RID: 407
            // (get) Token: 0x060003AB RID: 939 RVA: 0x000044A1 File Offset: 0x000026A1
            // (set) Token: 0x060003AC RID: 940 RVA: 0x000044A9 File Offset: 0x000026A9
            public string goods_id { get; set; }

            // Token: 0x17000198 RID: 408
            // (get) Token: 0x060003AD RID: 941 RVA: 0x000044B2 File Offset: 0x000026B2
            // (set) Token: 0x060003AE RID: 942 RVA: 0x000044BA File Offset: 0x000026BA
            public string goods_name { get; set; }

            // Token: 0x17000199 RID: 409
            // (get) Token: 0x060003AF RID: 943 RVA: 0x000044C3 File Offset: 0x000026C3
            // (set) Token: 0x060003B0 RID: 944 RVA: 0x000044CB File Offset: 0x000026CB
            public string price { get; set; }

            // Token: 0x1700019A RID: 410
            // (get) Token: 0x060003B1 RID: 945 RVA: 0x000044D4 File Offset: 0x000026D4
            // (set) Token: 0x060003B2 RID: 946 RVA: 0x000044DC File Offset: 0x000026DC
            public string quantity { get; set; }

            // Token: 0x060003B3 RID: 947 RVA: 0x0000286D File Offset: 0x00000A6D
            public SISSGood() {
                //Class15.cwcZ3SWztHroi();
                //base..ctor();
            }
        }

        // Token: 0x0200006F RID: 111
        private class SISSPayResult {
            // Token: 0x1700019B RID: 411
            // (get) Token: 0x060003B4 RID: 948 RVA: 0x000044E5 File Offset: 0x000026E5
            // (set) Token: 0x060003B5 RID: 949 RVA: 0x000044ED File Offset: 0x000026ED
            public string code { get; set; }

            // Token: 0x1700019C RID: 412
            // (get) Token: 0x060003B6 RID: 950 RVA: 0x000044F6 File Offset: 0x000026F6
            // (set) Token: 0x060003B7 RID: 951 RVA: 0x000044FE File Offset: 0x000026FE
            public string msg { get; set; }

            // Token: 0x1700019D RID: 413
            // (get) Token: 0x060003B8 RID: 952 RVA: 0x00004507 File Offset: 0x00002707
            // (set) Token: 0x060003B9 RID: 953 RVA: 0x0000450F File Offset: 0x0000270F
            public string SISS_pay_channel { get; set; }

            // Token: 0x1700019E RID: 414
            // (get) Token: 0x060003BA RID: 954 RVA: 0x00004518 File Offset: 0x00002718
            // (set) Token: 0x060003BB RID: 955 RVA: 0x00004520 File Offset: 0x00002720
            public string out_trade_no { get; set; }

            // Token: 0x1700019F RID: 415
            // (get) Token: 0x060003BC RID: 956 RVA: 0x00004529 File Offset: 0x00002729
            // (set) Token: 0x060003BD RID: 957 RVA: 0x00004531 File Offset: 0x00002731
            public string out_request_no { get; set; }

            // Token: 0x170001A0 RID: 416
            // (get) Token: 0x060003BE RID: 958 RVA: 0x0000453A File Offset: 0x0000273A
            // (set) Token: 0x060003BF RID: 959 RVA: 0x00004542 File Offset: 0x00002742
            public string trade_no { get; set; }

            // Token: 0x170001A1 RID: 417
            // (get) Token: 0x060003C0 RID: 960 RVA: 0x0000454B File Offset: 0x0000274B
            // (set) Token: 0x060003C1 RID: 961 RVA: 0x00004553 File Offset: 0x00002753
            public string pay_way { get; set; }

            // Token: 0x170001A2 RID: 418
            // (get) Token: 0x060003C2 RID: 962 RVA: 0x0000455C File Offset: 0x0000275C
            // (set) Token: 0x060003C3 RID: 963 RVA: 0x00004564 File Offset: 0x00002764
            public string trade_time { get; set; }

            // Token: 0x170001A3 RID: 419
            // (get) Token: 0x060003C4 RID: 964 RVA: 0x0000456D File Offset: 0x0000276D
            // (set) Token: 0x060003C5 RID: 965 RVA: 0x00004575 File Offset: 0x00002775
            public string total_amount { get; set; }

            // Token: 0x170001A4 RID: 420
            // (get) Token: 0x060003C6 RID: 966 RVA: 0x0000457E File Offset: 0x0000277E
            // (set) Token: 0x060003C7 RID: 967 RVA: 0x00004586 File Offset: 0x00002786
            public string trade_status { get; set; }

            // Token: 0x060003C8 RID: 968 RVA: 0x0000458F File Offset: 0x0000278F
            public SISSPayResult() {
                //Class15.cwcZ3SWztHroi();
                SISS_pay_channel = "SWIFTPASS";
                //base..ctor();
            }
        }

        // Token: 0x02000070 RID: 112
        private class SISSPayRequest {
            // Token: 0x170001A5 RID: 421
            // (get) Token: 0x060003C9 RID: 969 RVA: 0x000045A7 File Offset: 0x000027A7
            // (set) Token: 0x060003CA RID: 970 RVA: 0x000045AF File Offset: 0x000027AF
            public string String_0 { get; set; }

            // Token: 0x170001A6 RID: 422
            // (get) Token: 0x060003CB RID: 971 RVA: 0x000045B8 File Offset: 0x000027B8
            // (set) Token: 0x060003CC RID: 972 RVA: 0x000045C0 File Offset: 0x000027C0
            public string UPNo { get; set; }

            // Token: 0x170001A7 RID: 423
            // (get) Token: 0x060003CD RID: 973 RVA: 0x000045C9 File Offset: 0x000027C9
            // (set) Token: 0x060003CE RID: 974 RVA: 0x000045D1 File Offset: 0x000027D1
            public decimal UPAmount { get; set; }

            // Token: 0x170001A8 RID: 424
            // (get) Token: 0x060003CF RID: 975 RVA: 0x000045DA File Offset: 0x000027DA
            // (set) Token: 0x060003D0 RID: 976 RVA: 0x000045E2 File Offset: 0x000027E2
            public decimal UPRefundAmount { get; set; }

            // Token: 0x170001A9 RID: 425
            // (get) Token: 0x060003D1 RID: 977 RVA: 0x000045EB File Offset: 0x000027EB
            // (set) Token: 0x060003D2 RID: 978 RVA: 0x000045F3 File Offset: 0x000027F3
            public SISSGood[] goods_detail { get; set; }

            // Token: 0x170001AA RID: 426
            // (get) Token: 0x060003D3 RID: 979 RVA: 0x000045FC File Offset: 0x000027FC
            // (set) Token: 0x060003D4 RID: 980 RVA: 0x00004604 File Offset: 0x00002804
            public string discountable_amount { get; set; }

            // Token: 0x170001AB RID: 427
            // (get) Token: 0x060003D5 RID: 981 RVA: 0x0000460D File Offset: 0x0000280D
            // (set) Token: 0x060003D6 RID: 982 RVA: 0x00004615 File Offset: 0x00002815
            public string flow_no { get; set; }

            // Token: 0x170001AC RID: 428
            // (get) Token: 0x060003D7 RID: 983 RVA: 0x0000461E File Offset: 0x0000281E
            // (set) Token: 0x060003D8 RID: 984 RVA: 0x00004626 File Offset: 0x00002826
            public string out_Request_no { get; set; }

            // Token: 0x170001AD RID: 429
            // (get) Token: 0x060003D9 RID: 985 RVA: 0x0000462F File Offset: 0x0000282F
            // (set) Token: 0x060003DA RID: 986 RVA: 0x00004637 File Offset: 0x00002837
            public string order_title { get; set; }

            // Token: 0x170001AE RID: 430
            // (get) Token: 0x060003DB RID: 987 RVA: 0x00004640 File Offset: 0x00002840
            // (set) Token: 0x060003DC RID: 988 RVA: 0x00004648 File Offset: 0x00002848
            public string pay_way { get; set; }

            // Token: 0x170001AF RID: 431
            // (get) Token: 0x060003DD RID: 989 RVA: 0x00004651 File Offset: 0x00002851
            // (set) Token: 0x060003DE RID: 990 RVA: 0x00004659 File Offset: 0x00002859
            public string payc_ver { get; set; }

            // Token: 0x170001B0 RID: 432
            // (set) Token: 0x060003DF RID: 991 RVA: 0x0000F9CC File Offset: 0x0000DBCC
            public string request_data {
                set {
                    string[] array = value.Split(new string[]
                    {
                        "[sp]"
                    }, StringSplitOptions.None);
                    int num = string.IsNullOrEmpty(array[4]) ? 1 : 0;
                    String_0 = array[num + 1];
                    UPNo = array[num + 2];
                    UPAmount = HongshExtends.ConvertTo<decimal>(array[num + 4]);
                    UPRefundAmount = HongshExtends.ConvertTo<decimal>(array[num + 5]);
                }
            }

            // Token: 0x060003E0 RID: 992 RVA: 0x0000286D File Offset: 0x00000A6D
            public SISSPayRequest() {
                //Class15.cwcZ3SWztHroi();
                //base..ctor();
            }
        }

        // Token: 0x02000071 RID: 113
        private class SissPayAes {
            // Token: 0x170001B1 RID: 433
            // (get) Token: 0x060003E1 RID: 993 RVA: 0x00004662 File Offset: 0x00002862
            // (set) Token: 0x060003E2 RID: 994 RVA: 0x0000466A File Offset: 0x0000286A
            public string k { get; set; }

            // Token: 0x170001B2 RID: 434
            // (get) Token: 0x060003E3 RID: 995 RVA: 0x00004673 File Offset: 0x00002873
            // (set) Token: 0x060003E4 RID: 996 RVA: 0x0000467B File Offset: 0x0000287B
            public string v { get; set; }

            // Token: 0x170001B3 RID: 435
            // (get) Token: 0x060003E5 RID: 997 RVA: 0x00004684 File Offset: 0x00002884
            // (set) Token: 0x060003E6 RID: 998 RVA: 0x0000468C File Offset: 0x0000288C
            public string r { get; set; }

            // Token: 0x170001B4 RID: 436
            // (get) Token: 0x060003E7 RID: 999 RVA: 0x00004695 File Offset: 0x00002895
            // (set) Token: 0x060003E8 RID: 1000 RVA: 0x0000469D File Offset: 0x0000289D
            public string d { get; set; }

            // Token: 0x060003E9 RID: 1001 RVA: 0x0000286D File Offset: 0x00000A6D
            public SissPayAes() {
                //Class15.cwcZ3SWztHroi();
                //base..ctor();
            }
        }

        // Token: 0x02000072 RID: 114
        private class SissPayAesData {
            // Token: 0x170001B5 RID: 437
            // (get) Token: 0x060003EA RID: 1002 RVA: 0x000046A6 File Offset: 0x000028A6
            // (set) Token: 0x060003EB RID: 1003 RVA: 0x000046AE File Offset: 0x000028AE
            public string random_str_b { get; set; }

            // Token: 0x170001B6 RID: 438
            // (get) Token: 0x060003EC RID: 1004 RVA: 0x000046B7 File Offset: 0x000028B7
            // (set) Token: 0x060003ED RID: 1005 RVA: 0x000046BF File Offset: 0x000028BF
            public string auth_code { get; set; }

            // Token: 0x170001B7 RID: 439
            // (get) Token: 0x060003EE RID: 1006 RVA: 0x000046C8 File Offset: 0x000028C8
            // (set) Token: 0x060003EF RID: 1007 RVA: 0x000046D0 File Offset: 0x000028D0
            public decimal? total_amount { get; set; }

            // Token: 0x170001B8 RID: 440
            // (get) Token: 0x060003F0 RID: 1008 RVA: 0x000046D9 File Offset: 0x000028D9
            // (set) Token: 0x060003F1 RID: 1009 RVA: 0x000046E1 File Offset: 0x000028E1
            public string out_trade_no { get; set; }

            // Token: 0x170001B9 RID: 441
            // (get) Token: 0x060003F2 RID: 1010 RVA: 0x000046EA File Offset: 0x000028EA
            // (set) Token: 0x060003F3 RID: 1011 RVA: 0x000046F2 File Offset: 0x000028F2
            public string out_request_no { get; set; }

            // Token: 0x170001BA RID: 442
            // (get) Token: 0x060003F4 RID: 1012 RVA: 0x000046FB File Offset: 0x000028FB
            // (set) Token: 0x060003F5 RID: 1013 RVA: 0x00004703 File Offset: 0x00002903
            public SISSGood[] goods_detail { get; set; }

            // Token: 0x060003F6 RID: 1014 RVA: 0x0000286D File Offset: 0x00000A6D
            public SissPayAesData() {
                //Class15.cwcZ3SWztHroi();
                //base..ctor();
            }
        }

        // Token: 0x02000073 RID: 115
        private class SissPayRequestV2 : SissPayAesData {
            // Token: 0x170001BB RID: 443
            // (get) Token: 0x060003F7 RID: 1015 RVA: 0x0000470C File Offset: 0x0000290C
            // (set) Token: 0x060003F8 RID: 1016 RVA: 0x00004714 File Offset: 0x00002914
            public string pay_way { get; set; }

            // Token: 0x170001BC RID: 444
            // (get) Token: 0x060003F9 RID: 1017 RVA: 0x0000471D File Offset: 0x0000291D
            // (set) Token: 0x060003FA RID: 1018 RVA: 0x00004725 File Offset: 0x00002925
            public decimal refund_amount { get; set; }

            // Token: 0x170001BD RID: 445
            // (get) Token: 0x060003FB RID: 1019 RVA: 0x0000472E File Offset: 0x0000292E
            // (set) Token: 0x060003FC RID: 1020 RVA: 0x00004736 File Offset: 0x00002936
            public string order_title { get; set; }

            // Token: 0x170001BE RID: 446
            // (get) Token: 0x060003FD RID: 1021 RVA: 0x0000473F File Offset: 0x0000293F
            // (set) Token: 0x060003FE RID: 1022 RVA: 0x00004747 File Offset: 0x00002947
            public string flow_no { get; set; }

            // Token: 0x170001BF RID: 447
            // (get) Token: 0x060003FF RID: 1023 RVA: 0x00004750 File Offset: 0x00002950
            // (set) Token: 0x06000400 RID: 1024 RVA: 0x00004758 File Offset: 0x00002958
            public string req_aes_data { get; set; }

            // Token: 0x170001C0 RID: 448
            // (get) Token: 0x06000401 RID: 1025 RVA: 0x00004761 File Offset: 0x00002961
            // (set) Token: 0x06000402 RID: 1026 RVA: 0x00004769 File Offset: 0x00002969
            public decimal discountable_amount { get; set; }

            // Token: 0x170001C1 RID: 449
            // (get) Token: 0x06000403 RID: 1027 RVA: 0x00004772 File Offset: 0x00002972
            // (set) Token: 0x06000404 RID: 1028 RVA: 0x0000477A File Offset: 0x0000297A
            public decimal undiscountable_amount { get; set; }

            // Token: 0x06000405 RID: 1029 RVA: 0x00004783 File Offset: 0x00002983
            public SissPayRequestV2() {
                //Class15.cwcZ3SWztHroi();
                //base..ctor();
            }
        }

        // Token: 0x02000074 RID: 116
        private class SissPayResultV2 {
            // Token: 0x170001C2 RID: 450
            // (get) Token: 0x06000406 RID: 1030 RVA: 0x00004790 File Offset: 0x00002990
            // (set) Token: 0x06000407 RID: 1031 RVA: 0x00004798 File Offset: 0x00002998
            public string code { get; set; }

            // Token: 0x170001C3 RID: 451
            // (get) Token: 0x06000408 RID: 1032 RVA: 0x000047A1 File Offset: 0x000029A1
            // (set) Token: 0x06000409 RID: 1033 RVA: 0x000047A9 File Offset: 0x000029A9
            public string msg { get; set; }

            // Token: 0x170001C4 RID: 452
            // (get) Token: 0x0600040A RID: 1034 RVA: 0x000047B2 File Offset: 0x000029B2
            // (set) Token: 0x0600040B RID: 1035 RVA: 0x000047BA File Offset: 0x000029BA
            public string trade_no { get; set; }

            // Token: 0x170001C5 RID: 453
            // (get) Token: 0x0600040C RID: 1036 RVA: 0x000047C3 File Offset: 0x000029C3
            // (set) Token: 0x0600040D RID: 1037 RVA: 0x000047CB File Offset: 0x000029CB
            public string out_trade_no { get; set; }

            // Token: 0x170001C6 RID: 454
            // (get) Token: 0x0600040E RID: 1038 RVA: 0x000047D4 File Offset: 0x000029D4
            // (set) Token: 0x0600040F RID: 1039 RVA: 0x000047DC File Offset: 0x000029DC
            public string siss_pay_chanel { get; set; }

            // Token: 0x170001C7 RID: 455
            // (get) Token: 0x06000410 RID: 1040 RVA: 0x000047E5 File Offset: 0x000029E5
            // (set) Token: 0x06000411 RID: 1041 RVA: 0x000047ED File Offset: 0x000029ED
            public string pay_way { get; set; }

            // Token: 0x170001C8 RID: 456
            // (get) Token: 0x06000412 RID: 1042 RVA: 0x000047F6 File Offset: 0x000029F6
            // (set) Token: 0x06000413 RID: 1043 RVA: 0x000047FE File Offset: 0x000029FE
            public string total_amount { get; set; }

            // Token: 0x170001C9 RID: 457
            // (get) Token: 0x06000414 RID: 1044 RVA: 0x00004807 File Offset: 0x00002A07
            // (set) Token: 0x06000415 RID: 1045 RVA: 0x0000480F File Offset: 0x00002A0F
            public string receipt_amount { get; set; }

            // Token: 0x170001CA RID: 458
            // (get) Token: 0x06000416 RID: 1046 RVA: 0x00004818 File Offset: 0x00002A18
            // (set) Token: 0x06000417 RID: 1047 RVA: 0x00004820 File Offset: 0x00002A20
            public string trade_time { get; set; }

            // Token: 0x170001CB RID: 459
            // (get) Token: 0x06000418 RID: 1048 RVA: 0x00004829 File Offset: 0x00002A29
            // (set) Token: 0x06000419 RID: 1049 RVA: 0x00004831 File Offset: 0x00002A31
            public string trade_status { get; set; }

            // Token: 0x170001CC RID: 460
            // (get) Token: 0x0600041A RID: 1050 RVA: 0x0000483A File Offset: 0x00002A3A
            // (set) Token: 0x0600041B RID: 1051 RVA: 0x00004842 File Offset: 0x00002A42
            public string rsp_aes_data { get; set; }

            // Token: 0x0600041C RID: 1052 RVA: 0x0000484B File Offset: 0x00002A4B
            public SissPayResultV2() {
                //Class15.cwcZ3SWztHroi();
                siss_pay_chanel = "SWIFTPASS";
                //base..ctor();
            }
        }
    }
}
